# Maintainer: Keith Toh <ktprograms@gmail.com>
pkgname=tldr-python-client
pkgver=3.1.0
pkgrel=0
pkgdesc="Command line client for tldr, a collection of simplified and community-driven man pages"
url="https://github.com/tldr-pages/tldr-python-client"
arch="noarch"
license="MIT"
depends="python3 py3-shtab py3-colorama py3-termcolor"
makedepends="py3-setuptools py3-sphinx py3-sphinx-argparse"
checkdepends="py3-pytest"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tldr-pages/tldr-python-client/archive/refs/tags/$pkgver.tar.gz"

build() {
	make -C docs/ man
	python3 setup.py build
}

check() {
	# test_error_message needs network access
	pytest -v -k "not test_error_message"
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
	install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
53796b789e325dcab7f49df2b304fcc2e4163254927c1ade29914f33fe41f54f4fed36d89fce5d6d1eba5266f2e709e12da6602aeac32e45b5c527906a10cd99  tldr-python-client-3.1.0.tar.gz
"
